﻿using Microsoft.Extensions.Configuration;
using Model.Core.Services;

namespace GlobalData
{
    public class MqTopics
    {
        public MqTopics(LocalRobotInfo localRobotInfo)
        {
            LocalRobotInfo = localRobotInfo;
        }
        public string RobotId { get => LocalRobotInfo.RobotId; }
        /// <summary>
        /// 主要用于意美特堆料机器人的控制
        /// </summary>
        public string RobotCommandTopic { get => $"robot/{RobotId}/command"; }
        /// <summary>
        /// 主要用于意美特堆料机器人的设备状态展示
        /// </summary>
        public string RobotStatusTopic { get => $"robot/{RobotId}/status"; }
        /// <summary>
        /// 机器人电池状态
        /// </summary>
        public string RobotBatteryStatus_Topic { get => $"robot/{RobotId}/status/battery"; }
        /// <summary>
        /// 机器人当前运行速度
        /// </summary>
        public string RobotSpeedStatusTopic { get => $"robot/{RobotId}/status/speed"; }
        /// <summary>
        /// 机器人当前位置坐标
        /// </summary>
        public string RobotPointStatusTopic { get => $"robot/{RobotId}/status/point"; }

        /// <summary>
        /// 机器人当前轮控状态
        /// </summary>
        public string RobotWheelStatusTopic { get => $"robot/{RobotId}/status/wheel"; }
        /// <summary>
        /// 机器人当前轮控状态
        /// </summary>
        public string RobotWheelCommandTopic { get => $"robot/{RobotId}/command/wheel"; }
        /// <summary>
        /// 机器人移动控制
        /// </summary>
        public string Move_Topic { get => $"robot/{RobotId}/move"; }
        /// <summary>
        /// 机器人移动控制
        /// </summary>
        public string MoveToPoint_Topic { get => $"robot/{RobotId}/movetopoint"; }
        public string DoChargeTopic { get => $"robot/{RobotId}/docharge"; }
        /// <summary>
        /// 机器人任务控制
        /// </summary>
        public string Job_Ctrl_Topic { get => $"robot/{RobotId}/command/job"; }

        /// <summary>
        /// 机器人任务状态
        /// </summary>
        public string Job_Status_Topic { get => $"robot/{RobotId}/Status/job"; }


        /// <summary>
        /// 机器人顶升坐标上传
        /// </summary>
        public string Map_UpdateJack { get => $"robot/{RobotId}/map/update/jack"; }

        /// <summary>
        /// 用于搬运机器人升降地盘的推杆控制
        /// </summary>
        public string Jack_ctrl_Topic { get => $"robot/{RobotId}/jack"; }

        /// <summary>
        /// 机器人故障报警
        /// </summary>
        /// {"type":"wheel or job or motor","msg":"轮控故障/任务取消"}
        public string FaultAlertTopic { get => $"robot/{RobotId}/Error"; }

        IConfiguration _Configuration { get; }

        public string RobotJobListInfoGet_Topic { get => $"robot/{RobotId}/joblist/get"; }
        public string RobotJobListInfoPub_Topic { get => $"robot/{RobotId}/joblist/data"; }


        public string RobotPointListInfoGet_Topic { get => $"robot/{RobotId}/map/station/get"; }
        public string RobotPointListInfoPub_Topic { get => $"robot/{RobotId}/map/station/data"; }
        public LocalRobotInfo LocalRobotInfo { get; }


        /// <summary>
        /// 主要用于意美特堆料机器人的控制
        /// </summary>
        public const string RobotBaseInfoGet_Topic = "robot/baseinfo/get";
        public const string RobotBaseInfoPub_Topic = "robot/baseinfo/data";

        #region 用于机器人内部设备控制
        /// <summary>
        ///   堆料机器人控制 (机器人内部工控机使用) 
        /// </summary>
        public const string StackerLiftingInfo_Client = "md.robot.YiMeiTeLifting.info";
        public const string StackerLiftingCtrl_Client = "md.robot.YiMeiTeLifting.control";

        //处理顶升消息
        public const string md_robot_jack_info_Topic = "md/robot/jack/info";/// 顶升当前状态信息反馈
        public const string md_robot_jack_ctrl_Topic = "md/robot/jack/ctrl";/// 顶升控制

        public const string Robot_Local_Status_Battery = "md.robot.battery.info";// :电池电量/充电状态
        #endregion
    }
}
